#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
bool canPermutePalindrome(char* s) {
    int len = strlen(s);
    int ret = 0;
    int count = 0;
    int flag = 0;
    char* tmp = s;
    while (*tmp != 0)
    {
        ret ^= *tmp;
        tmp++;
    }
    while (*s != '\0')
    {
        if (*s == ret)
        {
            flag++;
        }
        s++;
    }
    cout << flag << endl;

    if ((ret != 0 && flag != 0) || (ret == 0 && flag==0))
        return true;

    else
        return false;

}
int main()
{
    char str[5] = "abdg";
    canPermutePalindrome(str);
}